#include<iostream>
#include<algorithm>

using namespace std;


int StrToInt(string str)
{
    int num = 0;
    int count = 1;
    int flag = 1;
    for (int i = str.size() - 1; i >= 0; --i)
    {

        if (str[i] >= '0' && str[i] <= '9')
        {
            str[i] -= '0';
            num += count * str[i];
            count *= 10;
        }
        else
        {
            if (str[i] == '-')
            {
                flag *= (-1);
            }
            else if (str[i] == '+')
            {
                ;
            }
            else
            {
                flag = 0;
            }
        }
    }

    return num * flag;
}

int main()
{
	string s("-1234355");

    cout << StrToInt(s) << endl;
	return 0;
}